package singleton;

//饿汉
public class HungrySingleton {

    //线程安全,避免性能问题.可能会浪费内存
    private static HungrySingleton singleton = new HungrySingleton();

    public HungrySingleton() {
    }

    public static HungrySingleton getSingleton(){
        return singleton;
    }
}
